<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
    *{
        margin: 20px auto;
    }
    a{
        display: block;
        width: 200px;
        text-align: center;
    }
    img{
        width: 300px;
        height: 200px;
        display: block;
    }
    input{
        display: block;
    }
    </style>
    <script type="text/javascript">
        window.onload=function(){
            alert("文档被加载");
        }

        function mouseover(){
                alert("鼠标进入链接");
            }

        function mouseout(){
            alert("鼠标离开连接");
        }

        function overpicture(){
            alert("鼠标进入图片区域");
        }

        function nopoint(){
            alert("输入框内容被改变");
        }
        
       document.onkeypress=function Enter(e){
            var code=e.keyCode;
            if(code==13){
                alert("回车键被按下");
            }
        }

        function Onclick(){
            alert("按钮被单击");
        }
    </script>
</head>
<body>
    <a href="" onmouseover="mouseover()" onmouseout="mouseout()">这是超链接</a>
    <img src="car.png" alt="" onmouseover="overpicture()">
    <input type="text" id="text" onkeypress="Enter()" onblur="nopoint()">
    <input type="button" value="这是按钮" onclick="Onclick()">
</body>
</html>